#include <stdio.h>
#include <string.h>
#include <math.h>

main()
{
	int icase=0, ncase;
	int a,b,c,d;
	scanf("%d", &ncase);
	while (ncase-->0)
	{

		scanf("%d%d%d%d", &a, &b, &c, &d);
		printf("Scenario #%d:\n", ++icase);
		if ((abs(a-c)%2==0 && abs(b-d)%2==1)||	
			(abs(a-c)%2==1 && abs(b-d)%2==0))
			printf("1\n\n");
		else printf("0\n\n");
			
		
	}
	return 0;
}